<!DOCTYPE html>
<html>
<head>
  <title>domaku | anime.js</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:title" content="anime.js">
  <meta property="og:url" content="http://anime-js.com">
  <meta property="og:description" content="Javascript Animation Engine">
  <meta property="og:image" content="http://anime-js.com/documentation/assets/img/icons/og.png">
  <meta name="twitter:card" content="summary">
  <meta name="twitter:title" content="anime.js">
  <meta name="twitter:site" content="@juliangarnier">
  <meta name="twitter:description" content="Javascript Animation Engine">
  <meta name="twitter:image" content="http://anime-js.com/documentation/assets/img/icons/twitter.png">
  <link rel="apple-touch-icon-precomposed" href="../assets/img/icons/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="../assets/img/icons/favicon.png">
  <link href="../assets/css/anime.css" rel="stylesheet">
  <!-- <script src="../../anime.js"></script> -->
  <script src="../assets/js/anime.2.0.1.js"></script>
  <!-- <script src="../assets/js/anime.1.3.js"></script> -->
  <style>
    body {
      position: absolute;
      width: 100%;
      height: 100%;
    }
    .particule {
      position: absolute;
      width: 4px;
      height: 4px;
      margin: -2px 0 0 -2px;
      border-radius: 50%;
      background-color: #FBF38C;
    }
  </style>
</head>
<body>
  <script>

    var maxElements = 3000;
    var duration = 1000;
    var width = window.innerWidth;
    var height = window.innerHeight;
    var distance = (width > height ? height : width) / 2.75;
    var fragment = document.createDocumentFragment();
    var i = 0;

    while (i <= maxElements) {
      var angle = Math.random() * Math.PI * 2;
      var el = document.createElement('div');
      el.classList.add('particule');
      anime({
        targets: el,
        left: [width/2+'px', Math.cos(angle) * distance + (width/2) + 'px'],
        top: [height/2+'px', Math.sin(angle) * distance + (height/2) + 'px'],
        delay: (duration / maxElements) * i,
        duration: duration,
        direction: 'reverse',
        easing: 'easeOutSine',
        loop: true
      });
      fragment.appendChild(el);
      i++;
    }

    document.body.appendChild(fragment);

  </script>
  <script src="../assets/js/stats.js"></script>
</body>
</html>
